// 1 引入express
const express = require("express");

const app = express();

//跨域
app.use(require("cors")());

//引入mongodb 连接文件
require("./plugins/db")(app);
//引入路由
require("./routes/web")(app);
app.listen(3002, err => {
  if (!err) {
    console.log("服务器启动，地址是localhost:3002");
  } else {
    console.log(err);
  }
});
